from flask import render_template, Blueprint

from models import Question

bp = Blueprint('index', __name__)

# 首页
@bp.route('/')
def index():
    # 首页展示问答列表
    questions = Question.query.order_by(Question.create_time.desc()).all()
    return render_template('index.html', questions=questions)